/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package me.zhengjie.modules.anniversary.service;

import me.zhengjie.modules.anniversary.domain.GzmuAnnUserContacts;
import me.zhengjie.modules.anniversary.domain.Student;
import me.zhengjie.modules.anniversary.service.dto.GzmuAnnUserContactsDto;
import me.zhengjie.modules.anniversary.service.dto.GzmuAnnUserContactsQueryCriteria;
import me.zhengjie.modules.anniversary.service.dto.StudentDto;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;

/**
 * @website https://el-admin.vip
 * @description 服务接口
 * @author yangyao
 * @date 2020-09-20
 **/
public interface GzmuAnnUserContactsService {

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String,Object>
     */
    Map<String,Object> queryAll(GzmuAnnUserContactsQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<GzmuAnnUserContactsDto>
     */
    List<GzmuAnnUserContactsDto> queryAll(GzmuAnnUserContactsQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return GzmuAnnUserContactsDto
     */
    GzmuAnnUserContactsDto findById(Long id);

    /**
     * 创建
     * @param resources /
     * @return GzmuAnnUserContactsDto
     */
    GzmuAnnUserContactsDto create(GzmuAnnUserContacts resources);

    /**
     * 编辑
     * @param resources /
     */
    void update(GzmuAnnUserContacts resources);

    /**
     * 多选删除
     * @param ids /
     */
    void deleteAll(Long[] ids);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<GzmuAnnUserContactsDto> all, HttpServletResponse response) throws IOException;


    /**
     * 根据姓名来查找当前登录用户的通讯录校友
     * @param myId  用户Id
     * @param name  通讯录校友名称
     * @param pageable 分页信息
     * @return  当前登录用户的通讯录校友
     */
    List<Map<String,Object>> findContactsByName(Long myId,String name,Pageable pageable);

    /**
     * 通过用户id查找申请成为该用户的用户
     * @param myId  用户Id
     * @param pageable    分页信息
     * @return  申请成为该用户的用户列表
     */
    List<Map<String,Object>> findContactsApply(Long myId, Pageable pageable);

    /**
     * 根据contactId修改状态
     * @param contactId 通讯录Id
     * @param consent   通讯录状态
     */
    void alterByContactsId(Long contactId, Integer consent);

    /**
     * 不分页查询
     * @param myId
     * @return
     */
    GzmuAnnUserContacts findByUserId(Long myId,Long userId);

    /**
     * 不分页查询
     * @param myId
     * @return
     */
    GzmuAnnUserContacts findByMyId(Long myId,Long userId);


    /**
     * 根据用户Id查询通讯录
     * @param myId 用户Id
     * @return  属于用户通讯录好友信息
     */
    List<Map<String,Object>> findByMyId(Long myId,Pageable pageable);

}
